package com.duobaoyu.dby.supply.common.biz.bo.order;

import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Optional;

/**
 * 订单金额统计BO
 * @author chenms
 * @date 2023/11/15 10:13 AM
 */
@Data
public class OrderAmountStatisticsBO implements Serializable {

    /**
     * 三方渠道
     */
    private String channelCode;

    /**
     * 订单状态
     */
    private Integer status;

    /**
     * 渠道订单总金额
     */
    private BigDecimal channelOrderAmount;

    /**
     * 渠道运费总金额
     */
    private BigDecimal channelFreightAmount;

    /**
     * 订单支付总金额
     */
    public BigDecimal orderPaymentAmount() {
        return Optional.ofNullable(channelFreightAmount).orElse(BigDecimal.ZERO).add(Optional.ofNullable(channelOrderAmount).orElse(BigDecimal.ZERO));
    }
}
